#ifndef SSLFRAME_H
#define SSLFRAME_H

#include <QFrame>
#include <QObject>

#include <functional>
#include <vector>
#include <memory>

class SSLClient;
class QComboBox;


class CryptoTool;

namespace Ui {
    class SSLFrame;
} // namespace Ui

class SSLFrame : public QFrame
{
  Q_OBJECT
public:
  enum TestType {
    TestCrypto,
    TestDigest,
    TestSymmetric,
    TestAsymmetric,
    TestSSL,
    TestPKI
  };
    SSLFrame(QWidget* parent);
    ~SSLFrame();
    void Init();
    void InitTestFunctions();
    void InitCryptoTool();

    void InitFunctor(TestType type);
    void RunFunctor(TestType type);

    void printMsg(const QString& text);
private slots:
    void OnTypeComboboxChanged(int index);

    void RunCryptoTool();


private:
    Ui::SSLFrame* ui;
    std::vector<std::function<void()> > funcs;
    SSLClient*    ssl_client_;
    TestType current_type_ = TestCrypto;
    std::unique_ptr<CryptoTool> crypto_tool_;
};

#endif // SSLFRAME_H
